api: add zone, vm name params in listVmSnapshot response#4604
api: add zone, vm name params in listVmSnapshot response#4604yadvr merged 4 commits intoapache:4.15from
Conversation
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
|
Packaging result: ✔centos7 ✔centos8 ✔debian. JID-2555 |
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
| if (vm != null) { | ||
| vmSnapshotResponse.setVirtualMachineid(vm.getUuid()); | ||
| vmSnapshotResponse.setVirtualMachineId(vm.getUuid()); | ||
| vmSnapshotResponse.setVirtualMachineName(vm.getHostName()); |
There was a problem hiding this comment.
I think display_name should be first choice, if it is null then we can go with host_name.
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
|
@shwstppr I do understand that it is good to display name(s) of resources/entities in the UI. But, I think, to change the respective API responses to include the name(s) of the required resources/entities (to show in the UI) may not be the right thing. The UUIDs can be further used with the list API(s) to get the required details (name, zone, etc) to fill the UI as desired. If we continue this exercise to show name(s) in the UI, finally we end up adding name(s) to most of the responses. I know UI has to attempt multiple API calls, but API responses should primarly return UUIDs. For names and other details, make use of list API calls. |
|
Packaging result: ✔centos7 ✔centos8 ✔debian. JID-2562 |
|
@shwstppr is this for 4.15 or master, pl change base branch or milestone |
|
@rhtyd sorry for the error. Changed the base branch @blueorangutan package |
|
@shwstppr a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
@sureshanaparti I may agree with you on that partly but changes aren't causing any additional db query, plus we have similar parameters in other api responses so maybe this can be allowed ;) |
|
Packaging result: ✔centos7 ✔centos8 ✔debian. JID-2568 |
Agree with you @shwstppr |
|
@blueorangutan test |
|
@shwstppr a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
@shwstppr So, do you mean it is the right approach to consider the API response object parameters for UI display? Few recent PRs below, with such changes where the response parameters are mainly updated for UI display only, and I'm sure this will repeat to replace most of the UUID displayed in the UI for the names. :-) #4483 - updated listNetworks API response for VPC Name |
|
@shwstppr May be some generic approach for the API response objects, to tag both UUID and Name (wherever UUID is returned) might work for all the APIs, and the names can be used appropriately in the UI when required. |
|
Trillian test result (tid-3408)
|
@sureshanaparti I get your proposal, but that I think it needs significant amount of changes as Name is not part of common interfaces (which I think is required for a generic approach) and it is defined as different names for each resource. May be an another improvement ticket would help this PR to get continued ! |
1 similar comment
|
@rhtyd a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress. |
|
@rhtyd a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress. |
|
UI build: ✔️ |
| vmSnapshotResponse.setVirtualMachineid(vm.getUuid()); | ||
| vmSnapshotResponse.setVirtualMachineId(vm.getUuid()); | ||
| vmSnapshotResponse.setVirtualMachineName(Strings.isNullOrEmpty(vm.getDisplayName()) ? vm.getHostName() : vm.getDisplayName()); | ||
| vmSnapshotResponse.setVirtualMachineName(vm.getHostName()); |
There was a problem hiding this comment.
Why is setVirtualMachineName() added twice @shwstppr ?
There was a problem hiding this comment.
@rhtyd that was by mistake in my previous commit 🤦 . Fixed it
|
@blueorangutan package |
|
@shwstppr a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔centos7 ✔centos8 ✔debian. JID-2686 |
| if (vm != null) { | ||
| vmSnapshotResponse.setVirtualMachineid(vm.getUuid()); | ||
| vmSnapshotResponse.setVirtualMachineId(vm.getUuid()); | ||
| vmSnapshotResponse.setVirtualMachineName(Strings.isNullOrEmpty(vm.getDisplayName()) ? vm.getHostName() : vm.getDisplayName()); |
There was a problem hiding this comment.
LGTM - we need one check if for normal user/account it leaks the internal hostname (is hostname the i-x-y-VM?)
There was a problem hiding this comment.
checked hostname would return name from the Db table, lgtm
Description
Adds new params in listVmSnapshot API -
zonename,virtualmachinenameFixes #4603
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
UI

After change zone name and VM name are shown
CMK:
Before -
After-